.class public Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;
.super Lcom/ninesky/browser/setting/BasePreferenceActivity;

# interfaces
.implements Landroid/preference/Preference$OnPreferenceChangeListener;


# instance fields
.field private b:Ljava/util/List;

.field private c:Ljava/util/List;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Lcom/ninesky/browser/setting/BasePreferenceActivity;-><init>()V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    return-void
.end method

.method private a(ZLandroid/preference/Preference;Ljava/util/List;)V
    .locals 3

    if-eqz p2, :cond_0

    if-eqz p3, :cond_0

    invoke-interface {p3}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-virtual {p0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

    move-result-object v0

    invoke-interface {p3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_2
    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_3

    if-eqz p1, :cond_4

    check-cast p2, Lcom/ninesky/browser/setting/BasePreference;

    const v0, 0x7f020078

    invoke-virtual {p2, v0}, Lcom/ninesky/browser/setting/BasePreference;->a(I)V

    goto :goto_0

    :cond_3
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/preference/Preference;

    if-eqz p0, :cond_2

    invoke-virtual {v0, p0}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z

    goto :goto_1

    :cond_4
    invoke-interface {p3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_5
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_6

    check-cast p2, Lcom/ninesky/browser/setting/BasePreference;

    const v0, 0x7f020079

    invoke-virtual {p2, v0}, Lcom/ninesky/browser/setting/BasePreference;->a(I)V

    goto :goto_0

    :cond_6
    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/preference/Preference;

    if-eqz p0, :cond_5

    invoke-virtual {v0, p0}, Landroid/preference/PreferenceScreen;->addPreference(Landroid/preference/Preference;)Z

    goto :goto_2
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 5

    const/4 v4, 0x1

    const/high16 v0, 0x7f05

    iput v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->a:I

    invoke-super {p0, p1}, Lcom/ninesky/browser/setting/BasePreferenceActivity;->onCreate(Landroid/os/Bundle;)V

    invoke-virtual {p0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->getPreferenceScreen()Landroid/preference/PreferenceScreen;

    move-result-object v0

    invoke-virtual {v0}, Landroid/preference/PreferenceScreen;->getSharedPreferences()Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "text_encode"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-virtual {v1, p0}, Landroid/preference/Preference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v2, "text_encode"

    const/4 v3, 0x0

    invoke-interface {v0, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c(Ljava/lang/String;)Ljava/lang/CharSequence;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

    const-string v0, "low_carbon_mode"

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/preference/Preference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v0, "private_mode"

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/preference/Preference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v0, "auto_update"

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/preference/Preference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->clear()V

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    const-string v1, "enable_image"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    const-string v1, "enable_flash"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    const-string v1, "js_can_open_window"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "enable_appcache"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "record_history"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "enable_cookie"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "save_password"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "save_form_data"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    iget-object v0, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    const-string v1, "enable_geolocation"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    invoke-interface {v0, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    invoke-static {}, Lcom/ninesky/browser/setting/a;->q()Lcom/ninesky/browser/setting/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/ninesky/browser/setting/a;->f()Z

    move-result v1

    if-eqz v1, :cond_0

    const-string v1, "low_carbon_mode"

    invoke-virtual {p0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v1

    iget-object v2, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    invoke-direct {p0, v4, v1, v2}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->a(ZLandroid/preference/Preference;Ljava/util/List;)V

    :cond_0
    invoke-virtual {v0}, Lcom/ninesky/browser/setting/a;->g()Z

    move-result v0

    if-eqz v0, :cond_1

    const-string v0, "private_mode"

    invoke-virtual {p0, v0}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v0

    iget-object v1, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    invoke-direct {p0, v4, v0, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->a(ZLandroid/preference/Preference;Ljava/util/List;)V

    :cond_1
    return-void
.end method

.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
    .locals 4

    const/4 v3, 0x1

    const/4 v0, 0x0

    invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;

    move-result-object v1

    const-string v2, "text_encode"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    check-cast p2, Ljava/lang/String;

    invoke-virtual {p0, p2}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c(Ljava/lang/String;)Ljava/lang/CharSequence;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V

    move v0, v3

    :cond_0
    :goto_0
    return v0

    :cond_1
    invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;

    move-result-object v1

    const-string v2, "low_carbon_mode"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    check-cast p2, Ljava/lang/Boolean;

    invoke-static {}, Lcom/ninesky/browser/setting/a;->q()Lcom/ninesky/browser/setting/a;

    move-result-object v0

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    invoke-virtual {v0, v1}, Lcom/ninesky/browser/setting/a;->c(Z)V

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    iget-object v1, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->b:Ljava/util/List;

    invoke-direct {p0, v0, p1, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->a(ZLandroid/preference/Preference;Ljava/util/List;)V

    move v0, v3

    goto :goto_0

    :cond_2
    invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;

    move-result-object v1

    const-string v2, "private_mode"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    check-cast p2, Ljava/lang/Boolean;

    invoke-static {}, Lcom/ninesky/browser/setting/a;->q()Lcom/ninesky/browser/setting/a;

    move-result-object v0

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    invoke-virtual {v0, v1}, Lcom/ninesky/browser/setting/a;->e(Z)V

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    iget-object v1, p0, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->c:Ljava/util/List;

    invoke-direct {p0, v0, p1, v1}, Lcom/ninesky/browser/setting/AdvancedPreferenceActivity;->a(ZLandroid/preference/Preference;Ljava/util/List;)V

    move v0, v3

    goto :goto_0

    :cond_3
    invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;

    move-result-object v1

    const-string v2, "auto_update"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    check-cast p2, Ljava/lang/Boolean;

    invoke-static {}, Lcom/ninesky/browser/setting/a;->q()Lcom/ninesky/browser/setting/a;

    move-result-object v0

    invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v1

    invoke-virtual {v0, v1}, Lcom/ninesky/browser/setting/a;->f(Z)V

    move v0, v3

    goto :goto_0
.end method
